/**
 * 文章发表模块接口列表
 */
import base from './base'; // 导入接口域名列表
import http from '../utils/http'; // 导入http中创建的axios实例

const logs = {    
    async getSMSList(param) {
        try {
            const res = await http.get(`${base.url.core}/logs_sms/list`, {
                params:param
            });
            if (res.data) {
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
        
    },
    async getCallList(param) {
        try {
            const res = await http.get(`${base.url.core}/logs_call/list`, {
                params:param
            });
            if (res.data) {
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
        
    },
    async getCost(param) {
        try {
            const res = await http.get(`${base.url.core}/logs_call/cost`, {
                params:param
            });
            if (res.data) {
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
        
    },
    async getNoticeList(param) {
        try {
            const res = await http.get(`${base.url.core}/logs_sys/list`, {
                params:param
            });
            if (res.data) {
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
        
    },
    async delSMS(params) {
        try {
            let formData = new FormData
            formData.append("id",params.id);
            const res = await http.post(`${base.url.core}/logs_sms/del`,formData);
            if (res.data) {                
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
    },
    async delCall(params) {
        try {
            let formData = new FormData
            formData.append("id",params.id);
            const res = await http.post(`${base.url.core}/logs_call/del`,formData);
            if (res.data) {                
                return res.data.result;
            }
        }
        catch (err) {
            return Promise.reject(err);
        }
    }
}
export default logs;
